package cn.edu.Day05;

import java.awt.*;
import java.util.Random;

public class Star {
    private static Random ram;
    static {
        ram =new Random();
    }
    public Star()
    {
        //将颜色和大小都设置好
        color=new Color(ram.nextInt(256),ram.nextInt(256),ram.nextInt(256));
        font =new Font("宋体",Font.BOLD,ram.nextInt(11)+10);
        speed=(ram.nextInt(3)+1)*3;
        x=ram.nextInt(MyFrame.W);
        y=ram.nextInt(MyFrame.H);
    }
    //画星星
    public static final String name="*";
    //星星的坐标
    private int x;
    private int y;
    //定义星星的颜色
    private Color color;
    //定义星星的字体
    private Font font;
    //完善星星的速度
    private int speed;

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    public Color getColor() {
        return color;
    }

    public Font getFont() {
        return font;
    }

    public void setFont(Font font) {
        this.font = font;
    }

    public void setColor(Color color) {
        this.color = color;
    }

    public int getSpeed() {
        return speed;
    }

    public void setSpeed(int speed) {
        this.speed = speed;
    }
}
